package com.woniu.woniu_bx.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.woniu.woniu_bx.groups.AddGroup;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @ClassName Moment
 * @Description TODO
 * @Author 于文龙
 * @Date 2022/8/27 15:34
 * @Version 1.0
 **/
@Data
@TableName("bx_moment")
@JsonIgnoreProperties(value = {"handler","hibernateLazyInitializer","fieldHandler"})
public class Moment {
    //id
    private Integer id;

    @NotNull(groups = AddGroup.class)
    //发布者id
    private Integer userId;

    //发布者昵称
    @TableField(exist = false)
    private User user;


    @NotNull(groups = AddGroup.class)
    //内容
    private String content;

    //发布时间
    private String time;
    //点赞数
    private Integer likeNum;

    //浏览量
    private Integer readNum;


    //评论
    @TableField(exist = false)
    private List<Discuss> discuss;

    //动态图片
    @TableField(exist = false)
    private List<String> imgs;

    // 评论数量
    @TableField(exist = false)
    private Integer discussNum;

    // 逻辑发布时间
    @TableField(exist = false)
    private String logicTime;

    // 当前登录用户是否已 关注 该条动态作者
    @TableField(exist = false)
    private boolean careMomentUser;

    // 当前登录用户是否已 点赞 该条动态
    @TableField(exist = false)
    private boolean likeMoment;
}
